<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr style="background-color:aqua;">
                    <td>序号</td>
                    <td>姓名</td>
                    <td>手机号</td>
                    <td>账号</td>
                    <td>密码</td>
                    <td>所属角色</td>
                    <td>创建人</td>
                </tr>
                <tr v-for="item in querinfo">
                    <td>{{ item.id }}</td>
                    <td>{{ item.name }}</td>
                    <td>{{ item.phone }}</td>
                    <td>{{ item.username }}</td>
                    <td>****</td>
                    <td>{{ item.juese }}</td>
                    <td>{{ item.crename }}</td>
                </tr>
            </tbody>
        </table>
        
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref, reactive, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import {useStore} from '@/stores/user'
const a = useStore();
const route = useRoute();
const router = useRouter();

let querinfo:any=ref([{

}])
onMounted(()=>{
    if(a.userinfo.id)
{
    lists();
}
else
{
    router.push("/login")
}

})
const lists=()=>{
    axios({
        url:'/api/Admin/Adminlist',
        method:'get'
    })
    .then(res=>{
        console.log(res);
        querinfo.value=res.data
    })
    .catch(err=>{
        console.log(err)
    })
}
</script>

<style scoped>

</style>